<?php defined('RUN_KATANA') or die('Restricted access'); ?>
<?php 
if(OUTPUT_FORMAT == 'json')
{
	$items = $adc->getAdModels();
	if($items)
	{
		$i = 0;
		foreach($items as $item)
		{
			if((intval($_GET['brandId']) == 0) || (intval($_GET['brandId']) == $item->getBrandId()) || ($item->getBrandId() == 0))
			{
				$json[$i]['id'] = $item->getId();
				$json[$i]['title'] = $item->getTitle();
				$i++;
			}
		}
		echo json_encode($json);
	}
}
?>